package cn.controller;

import cn.entity.Student;
import cn.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by Administrator on 2018/1/16 0016.
 */
@RestController
@RequestMapping("/student/")
public class StudentController {
    @Autowired
    private IStudentService iStudentService;

    /**
     * 页面跳转
     */
    @RequestMapping("{pageName}")
    public ModelAndView jump(@PathVariable String pageName) {
        ModelAndView view = new ModelAndView();
        view.setViewName(pageName);
        return view;
    }

    @RequestMapping("get")
    public Student get(Long id) {
        Student student = iStudentService.get(id);
        return student;

    }
}
